//
//  TableView.swift
//  Swift-WB
//
//  Created by lxy on 2017/6/6.
//  Copyright © 2017年 lixiya. All rights reserved.
//

import UIKit

class TableView: UITableView {

    override init(frame: CGRect, style: UITableViewStyle) {
        super.init(frame: frame, style: style)
        
        // 解决cell上按钮点击不出现高亮问题
        self.delaysContentTouches = false
        self.backgroundColor = UIColor.clear
        
        for obj in self.subviews {
            let className = NSStringFromClass(obj.classForCoder)
            if className == "UITableViewWrapperView" {
                if obj is UIScrollView {
                    let scroll = obj as! UIScrollView
                    scroll.delaysContentTouches = false
                }
            }
        }
        
    }
    
    required init?(coder aDecoder: NSCoder) {
        fatalError("init(coder:) has not been implemented")
    }

}
